<template>
  <div>
    <el-input
      placeholder="请输入房产信息"
      v-model="input"
      class="input-with-select"
    >
      <el-button slot="append" icon="el-icon-search" @click="searchFn"></el-button>
    </el-input>
  </div>
</template>

<script>
export default {
  data() {
    return {
      input: "",
    };
  },
  methods:{
      searchFn(){
          if(!this.input){
            this.$message.warning('请输入房产信息!')
            return
          }
          this.$router.push({
              path:'/search',
              query:{
                 title_contains:this.input
              }
          })
      }
  }
};
</script>

<style lang="less" scoped>
.el-input {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  position: fixed;
  width: 500px;
}

</style>
